home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / CMICCProfile.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  26KB  |  836 lines

  1. /*
  2.      File:        CMICCProfile.h
  3.  
  4.      Contains:    Definitions for ColorSync 2.0 profile
  5.  
  6.      Version:    Technology:    ColorSync 2.0
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __CMICCPROFILE__
  19. #define __CMICCPROFILE__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28.  
  29. #if PRAGMA_IMPORT_SUPPORTED
  30. #pragma import on
  31. #endif
  32.  
  33. #if PRAGMA_ALIGN_SUPPORTED
  34. #pragma options align=mac68k
  35. #endif
  36.  
  37. /* Current CMProfile.header.profileVersion Major: 2, Minor: 0, Stage: Developement (x20), Prerelease:0x01 */
  38.  
  39. enum {
  40.     cmCS2ProfileVersion            = 0x02000000
  41. };
  42.  
  43. /* Current Major version number */
  44.  
  45. enum {
  46.     cmCurrentProfileMajorVersion = 0x02000000
  47. };
  48.  
  49. /* magic cookie number for anonymous file ID */
  50.  
  51. enum {
  52.     cmMagicNumber                = 'acsp'
  53. };
  54.  
  55. /* ColorSync profile version 1.0 */
  56.  
  57. enum {
  58.     cmCS1ProfileVersion            = 0x00000100
  59. };
  60.  
  61. /************************************************************************/
  62. /*************** ColorSync 2.0 profile specification ********************/
  63. /************************************************************************/
  64. /* profile flags element values */
  65.  
  66. enum {
  67.     cmEmbeddedProfile            = 0,                            /* 0 is not embedded profile, 1 is embedded profile */
  68.     cmEmbeddedUse                = 1                                /* 0 is to use anywhere, 1 is to use as embedded profile only */
  69. };
  70.  
  71. /* data type element values */
  72.  
  73. enum {
  74.     cmAsciiData                    = 0,
  75.     cmBinaryData                = 1
  76. };
  77.  
  78. /* rendering intent element values  */
  79.  
  80. enum {
  81.     cmPerceptual                = 0,                            /* Photographic images */
  82.     cmRelativeColorimetric        = 1,                            /* Logo Colors */
  83.     cmSaturation                = 2,                            /* Business graphics */
  84.     cmAbsoluteColorimetric        = 3                                /* Logo Colors */
  85. };
  86.  
  87. /* speed and quality flag options */
  88.  
  89. enum {
  90.     cmNormalMode                = 0,                            /* it uses the least significent two bits in the high word of flag */
  91.     cmDraftMode                    = 1,                            /* it should be evaulated like this: right shift 16 bits first, mask off the */
  92.     cmBestMode                    = 2                                /* high 14 bits, and then compare with the enum to determine the option value */
  93. };
  94.  
  95. /* device/media attributes element values  */
  96.  
  97. enum {
  98.     cmReflective                = 0,                            /* 0 is reflective media, 1 is transparency media */
  99.     cmGlossy                    = 1                                /* 0 is glossy, 1 is matte */
  100. };
  101.  
  102. /* screen encodings  */
  103.  
  104. enum {
  105.     cmPrtrDefaultScreens        = 0,                            /* Use printer default screens.  0 is false, 1 is ture */
  106.     cmLinesPer                    = 1                                /* 0 is LinesPerCm, 1 is LinesPerInch */
  107. };
  108.  
  109. /* 2.0 tag type information */
  110.  
  111. enum {
  112.     cmNumHeaderElements            = 10
  113. };
  114.  
  115. /* public tags */
  116.  
  117. enum {
  118.     cmAToB0Tag                    = 'A2B0',
  119.     cmAToB1Tag                    = 'A2B1',
  120.     cmAToB2Tag                    = 'A2B2',
  121.     cmBlueColorantTag            = 'bXYZ',
  122.     cmBlueTRCTag                = 'bTRC',
  123.     cmBToA0Tag                    = 'B2A0',
  124.     cmBToA1Tag                    = 'B2A1',
  125.     cmBToA2Tag                    = 'B2A2',
  126.     cmCalibrationDateTimeTag    = 'calt',
  127.     cmCharTargetTag                = 'targ',
  128.     cmCopyrightTag                = 'cprt',
  129.     cmDeviceMfgDescTag            = 'dmnd',
  130.     cmDeviceModelDescTag        = 'dmdd',
  131.     cmGamutTag                    = 'gamt',
  132.     cmGrayTRCTag                = 'kTRC',
  133.     cmGreenColorantTag            = 'gXYZ',
  134.     cmGreenTRCTag                = 'gTRC',
  135.     cmLuminanceTag                = 'lumi',
  136.     cmMeasurementTag            = 'meas',
  137.     cmMediaBlackPointTag        = 'bkpt',
  138.     cmMediaWhitePointTag        = 'wtpt',
  139.     cmNamedColorTag                = 'ncol',
  140.     cmNamedColor2Tag            = 'ncl2',
  141.     cmPreview0Tag                = 'pre0',
  142.     cmPreview1Tag                = 'pre1',
  143.     cmPreview2Tag                = 'pre2',
  144.     cmProfileDescriptionTag        = 'desc',
  145.     cmProfileSequenceDescTag    = 'pseq',
  146.     cmPS2CRD0Tag                = 'psd0',
  147.     cmPS2CRD1Tag                = 'psd1',
  148.     cmPS2CRD2Tag                = 'psd2',
  149.     cmPS2CRD3Tag                = 'psd3',
  150.     cmPS2CSATag                    = 'ps2s',
  151.     cmPS2RenderingIntentTag        = 'ps2i',
  152.     cmRedColorantTag            = 'rXYZ',
  153.     cmRedTRCTag                    = 'rTRC',
  154.     cmScreeningDescTag            = 'scrd',
  155.     cmScreeningTag                = 'scrn',
  156.     cmTechnologyTag                = 'tech',
  157.     cmUcrBgTag                    = 'bfd ',
  158.     cmViewingConditionsDescTag    = 'vued',
  159.     cmViewingConditionsTag        = 'view'
  160. };
  161.  
  162. /* custom tags */
  163.  
  164. enum {
  165.     cmPS2CRDVMSizeTag            = 'psvm'
  166. };
  167.  
  168. /* technology tag descriptions */
  169.  
  170. enum {
  171.     cmTechnologyFilmScanner        = 'fscn',
  172.     cmTechnologyReflectiveScanner = 'rscn',
  173.     cmTechnologyInkJetPrinter    = 'ijet',
  174.     cmTechnologyThermalWaxPrinter = 'twax',
  175.     cmTechnologyElectrophotographicPrinter = 'epho',
  176.     cmTechnologyElectrostaticPrinter = 'esta',
  177.     cmTechnologyDyeSublimationPrinter = 'dsub',
  178.     cmTechnologyPhotographicPaperPrinter = 'rpho',
  179.     cmTechnologyFilmWriter        = 'fprn',
  180.     cmTechnologyVideoMonitor    = 'vidm',
  181.     cmTechnologyVideoCamera        = 'vidc',
  182.     cmTechnologyProjectionTelevision = 'pjtv',
  183.     cmTechnologyCRTDisplay        = 'CRT ',
  184.     cmTechnologyPMDisplay        = 'PMD ',
  185.     cmTechnologyAMDisplay        = 'AMD ',
  186.     cmTechnologyPhotoCD            = 'KPCD',
  187.     cmTechnologyPhotoImageSetter = 'imgs',
  188.     cmTechnologyGravure            = 'grav',
  189.     cmTechnologyOffsetLithography = 'offs',
  190.     cmTechnologySilkscreen        = 'silk',
  191.     cmTechnologyFlexography        = 'flex'
  192. };
  193.  
  194. /* type signatures */
  195.  
  196. enum {
  197.     cmSigCurveType                = 'curv',
  198.     cmSigDataType                = 'data',
  199.     cmSigDateTimeType            = 'dtim',
  200.     cmSigLut16Type                = 'mft2',
  201.     cmSigLut8Type                = 'mft1',
  202.     cmSigMeasurementType        = 'meas',
  203.     cmSigNamedColorType            = 'ncol',
  204.     cmSigNamedColor2Type        = 'ncl2',
  205.     cmSigProfileDescriptionType    = 'desc',
  206.     cmSigScreeningType            = 'scrn',
  207.     cmSigS15Fixed16Type            = 'sf32',
  208.     cmSigSignatureType            = 'sig ',
  209.     cmSigTextType                = 'text',
  210.     cmSigU16Fixed16Type            = 'uf32',
  211.     cmSigU1Fixed15Type            = 'uf16',
  212.     cmSigUInt32Type                = 'ui32',
  213.     cmSigUInt64Type                = 'ui64',
  214.     cmSigUInt8Type                = 'ui08',
  215.     cmSigViewingConditionsType    = 'view',
  216.     cmSigXYZType                = 'XYZ '
  217. };
  218.  
  219. /* Measurement type encodings */
  220. /* Measurement Flare */
  221.  
  222. enum {
  223.     cmFlare0                    = 0x00000000,
  224.     cmFlare100                    = 0x00000001
  225. };
  226.  
  227. /* Measurement Geometry    */
  228.  
  229. enum {
  230.     cmGeometryUnknown            = 0x00000000,
  231.     cmGeometry045or450            = 0x00000001,
  232.     cmGeometry0dord0            = 0x00000002
  233. };
  234.  
  235. /* Standard Observer    */
  236.  
  237. enum {
  238.     cmStdobsUnknown                = 0x00000000,
  239.     cmStdobs1931TwoDegrees        = 0x00000001,
  240.     cmStdobs1964TenDegrees        = 0x00000002
  241. };
  242.  
  243. /* Standard Illuminant */
  244.  
  245. enum {
  246.     cmIlluminantUnknown            = 0x00000000,
  247.     cmIlluminantD50                = 0x00000001,
  248.     cmIlluminantD65                = 0x00000002,
  249.     cmIlluminantD93                = 0x00000003,
  250.     cmIlluminantF2                = 0x00000004,
  251.     cmIlluminantD55                = 0x00000005,
  252.     cmIlluminantA                = 0x00000006,
  253.     cmIlluminantEquiPower        = 0x00000007,
  254.     cmIlluminantF8                = 0x00000008
  255. };
  256.  
  257. /* Spot Function Value */
  258.  
  259. enum {
  260.     cmSpotFunctionUnknown        = 0,
  261.     cmSpotFunctionDefault        = 1,
  262.     cmSpotFunctionRound            = 2,
  263.     cmSpotFunctionDiamond        = 3,
  264.     cmSpotFunctionEllipse        = 4,
  265.     cmSpotFunctionLine            = 5,
  266.     cmSpotFunctionSquare        = 6,
  267.     cmSpotFunctionCross            = 7
  268. };
  269.  
  270. /* Color Space Signatures */
  271.  
  272. enum {
  273.     cmXYZData                    = 'XYZ ',
  274.     cmLabData                    = 'Lab ',
  275.     cmLuvData                    = 'Luv ',
  276.     cmYxyData                    = 'Yxy ',
  277.     cmRGBData                    = 'RGB ',
  278.     cmGrayData                    = 'GRAY',
  279.     cmHSVData                    = 'HSV ',
  280.     cmHLSData                    = 'HLS ',
  281.     cmCMYKData                    = 'CMYK',
  282.     cmCMYData                    = 'CMY ',
  283.     cmMCH5Data                    = 'MCH5',
  284.     cmMCH6Data                    = 'MCH6',
  285.     cmMCH7Data                    = 'MCH7',
  286.     cmMCH8Data                    = 'MCH8'
  287. };
  288.  
  289. /* profileClass enumerations */
  290.  
  291. enum {
  292.     cmInputClass                = 'scnr',
  293.     cmDisplayClass                = 'mntr',
  294.     cmOutputClass                = 'prtr',
  295.     cmLinkClass                    = 'link',
  296.     cmAbstractClass                = 'abst',
  297.     cmColorSpaceClass            = 'spac'
  298. };
  299.  
  300. /* platform enumerations */
  301.  
  302. enum {
  303.     cmMacintosh                    = 'APPL',
  304.     cmMicrosoft                    = 'MSFT',
  305.     cmSolaris                    = 'SUNW',
  306.     cmSiliconGraphics            = 'SGI ',
  307.     cmTaligent                    = 'TGNT'
  308. };
  309.  
  310. /* ColorSync 1.0 elements */
  311.  
  312. enum {
  313.     cmCS1ChromTag                = 'chrm',
  314.     cmCS1TRCTag                    = 'trc ',
  315.     cmCS1NameTag                = 'name',
  316.     cmCS1CustTag                = 'cust'
  317. };
  318.  
  319. /* General element data types */
  320. struct CMDateTime {
  321.     unsigned short                     year;
  322.     unsigned short                     month;
  323.     unsigned short                     dayOfTheMonth;
  324.     unsigned short                     hours;
  325.     unsigned short                     minutes;
  326.     unsigned short                     seconds;
  327. };
  328. typedef struct CMDateTime CMDateTime;
  329.  
  330. struct CMFixedXYZColor {
  331.     Fixed                             X;
  332.     Fixed                             Y;
  333.     Fixed                             Z;
  334. };
  335. typedef struct CMFixedXYZColor CMFixedXYZColor;
  336.  
  337. typedef unsigned short CMXYZComponent;
  338. struct CMXYZColor {
  339.     CMXYZComponent                     X;
  340.     CMXYZComponent                     Y;
  341.     CMXYZComponent                     Z;
  342. };
  343. typedef struct CMXYZColor CMXYZColor;
  344.  
  345. struct CM2Header {
  346.     unsigned long                     size;                        /* This is the total size of the Profile */
  347.     OSType                             CMMType;                    /* CMM signature,  Registered with CS2 consortium  */
  348.     unsigned long                     profileVersion;                /* Version of CMProfile format */
  349.     OSType                             profileClass;                /* input, display, output, devicelink, abstract, or color conversion profile type */
  350.     OSType                             dataColorSpace;                /* color space of data */
  351.     OSType                             profileConnectionSpace;        /* profile connection color space */
  352.     CMDateTime                         dateTime;                    /* date and time of profile creation */
  353.     OSType                             CS2profileSignature;        /* 'acsp' constant ColorSync 2.0 file ID */
  354.     OSType                             platform;                    /* primary profile platform, Registered with CS2 consortium */
  355.     unsigned long                     flags;                        /* profile flags */
  356.     OSType                             deviceManufacturer;            /* Registered with ICC consortium */
  357.     unsigned long                     deviceModel;                /* Registered with ICC consortium */
  358.     unsigned long                     deviceAttributes[2];        /* Attributes like paper type */
  359.     unsigned long                     renderingIntent;            /* preferred rendering intent of tagged object */
  360.     CMFixedXYZColor                 white;                        /* profile illuminant */
  361.     OSType                             creator;                    /* profile creator */
  362.     char                             reserved[44];                /* reserved for future use */
  363. };
  364. typedef struct CM2Header CM2Header;
  365.  
  366. struct CMTagRecord {
  367.     OSType                             tag;                        /* Registered with CS2 consortium */
  368.     unsigned long                     elementOffset;                /* Relative to start of CMProfile */
  369.     unsigned long                     elementSize;
  370. };
  371. typedef struct CMTagRecord CMTagRecord;
  372.  
  373. struct CMTagElemTable {
  374.     unsigned long                     count;
  375.     CMTagRecord                     tagList[1];                    /* Variable size */
  376. };
  377. typedef struct CMTagElemTable CMTagElemTable;
  378.  
  379. /* External 0x02002001 CMProfile */
  380. struct CM2Profile {
  381.     CM2Header                         header;
  382.     CMTagElemTable                     tagTable;
  383.     char                             elemData[1];                /* Tagged element storage. Variable size */
  384. };
  385. typedef struct CM2Profile CM2Profile;
  386.  
  387. typedef CM2Profile *CM2ProfilePtr;
  388. typedef CM2ProfilePtr *CM2ProfileHandle;
  389. /* Tag Type Definitions */
  390. struct CMCurveType {
  391.     OSType                             typeDescriptor;                /* 'curv' */
  392.     unsigned long                     reserved;                    /* fill with 0x00 */
  393.     unsigned long                     countValue;                    /* number of entries in table that follows */
  394.     unsigned short                     data[1];                    /* Tagged element storage. Variable size */
  395. };
  396. typedef struct CMCurveType CMCurveType;
  397.  
  398. struct CMDataType {
  399.     OSType                             typeDescriptor;                /* 'data' */
  400.     unsigned long                     reserved;                    /* fill with 0x00 */
  401.     unsigned long                     dataFlag;                    /* 0 = ASCII, 1 = binary */
  402.     char                             data[1];                    /* Tagged element storage. Variable size */
  403. };
  404. typedef struct CMDataType CMDataType;
  405.  
  406. struct CMDateTimeType {
  407.     OSType                             typeDescriptor;                /* 'dtim' */
  408.     unsigned long                     reserved;
  409.     CMDateTime                         dateTime;
  410. };
  411. typedef struct CMDateTimeType CMDateTimeType;
  412.  
  413. struct CMLut16Type {
  414.     OSType                             typeDescriptor;                /* 'mft2' */
  415.     unsigned long                     reserved;                    /* fill with 0x00 */
  416.     unsigned char                     inputChannels;                /* Number of input channels */
  417.     unsigned char                     outputChannels;                /* Number of output channels */
  418.     unsigned char                     gridPoints;                    /* Number of clutTable grid points */
  419.     unsigned char                     reserved2;                    /* fill with 0x00 */
  420.     Fixed                             matrix[3][3];                /* */
  421.     unsigned short                     inputTableEntries;            /* */
  422.     unsigned short                     outputTableEntries;            /* */
  423.     unsigned short                     inputTable[1];                /* Variable size */
  424.     unsigned short                     CLUT[1];                    /* Variable size */
  425.     unsigned short                     outputTable[1];                /* Variable size */
  426. };
  427. typedef struct CMLut16Type CMLut16Type;
  428.  
  429. struct CMLut8Type {
  430.     OSType                             typeDescriptor;                /* 'mft1' */
  431.     unsigned long                     reserved;                    /* fill with 0x00 */
  432.     unsigned char                     inputChannels;                /* */
  433.     unsigned char                     outputChannels;                /* */
  434.     unsigned char                     gridPoints;                    /* */
  435.     unsigned char                     reserved2;                    /* fill with 0x00 */
  436.     Fixed                             matrix[3][3];                /* */
  437.     unsigned char                     inputTable[256];            /* fixed size of 256 */
  438.     unsigned char                     CLUT[2];                    /* Variable size */
  439.     unsigned char                     outputTable[256];            /* fixed size of 256 */
  440. };
  441. typedef struct CMLut8Type CMLut8Type;
  442.  
  443. struct CMMeasurementType {
  444.     OSType                             typeDescriptor;                /* 'meas' */
  445.     unsigned long                     reserved;                    /* fill with 0x00 */
  446.     unsigned long                     standardObserver;            /* 0 : unknown, 1 : CIE 1931, 2 : CIE 1964 */
  447.     CMFixedXYZColor                 backingXYZ;                    /* absolute XYZ values of backing */
  448.     unsigned long                     geometry;                    /* 0 : unknown, 1 : 0/45 or 45/0, 2 :0/d or d/0 */
  449.     unsigned long                     flare;                        /* 0 : 0%, 1 : 100% flare */
  450.     unsigned long                     illuminant;                    /* standard illuminant */
  451. };
  452. typedef struct CMMeasurementType CMMeasurementType;
  453.  
  454. struct CMNamedColorType {
  455.     OSType                             typeDescriptor;                /* 'ncol' */
  456.     unsigned long                     reserved;                    /* fill with 0x00 */
  457.     unsigned long                     vendorFlag;                    /* */
  458.     unsigned long                     count;                        /* count of named colors in array that follows */
  459.     unsigned char                     prefixName[1];                /* Variable size, max = 32, to access fields after this one, have to count bytes */
  460.     unsigned char                     suffixName[1];                /* Variable size, max = 32 */
  461.     char                             data[1];                    /* varaible size data as explained below */
  462. };
  463. typedef struct CMNamedColorType CMNamedColorType;
  464.  
  465. /*
  466.     A variable size array of structs appears as the last block of data
  467.     in the above struct, CMNamedColorType.  The data structure
  468.     is as follows: (example in C)
  469.     
  470.      struct {                                             
  471.             unsigned char    rootName[1];                 * Variable size, max = 32 
  472.             unsigned char    colorCoords[1];                 * Variable size  
  473.      } colorName[1];                                     * Variable size  
  474. */
  475. struct CMNamedColor2Type {
  476.     OSType                             typeDescriptor;                /* 'ncl2' */
  477.     unsigned long                     reserved;                    /* fill with 0x00 */
  478.     unsigned long                     vendorFlag;                    /* lower 16 bits reserved for ICC use */
  479.     unsigned long                     count;                        /* count of named colors in array that follows */
  480.     unsigned long                     deviceChannelCount;            /* number of device channels, 0 indicates no device value available */
  481.     unsigned char                     prefixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  482.     unsigned char                     suffixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  483.     char                             data[1];                    /* varaible size data as explained below */
  484. };
  485. typedef struct CMNamedColor2Type CMNamedColor2Type;
  486.  
  487. /*
  488.     A variable size array of structs appears as the last block of data
  489.     in the above struct, CMNamedColor2Type.  The data structure
  490.     is as follows: (example in C)
  491.     
  492.      struct {                                             
  493.             unsigned char    rootName[1];                 * 32 byte field.  7 bit ASCII null terminated
  494.             unsigned char    PCSColorCoords[1];             * Variable size  
  495.             unsigned char    DeviceColorCoords[1];         * Variable size  
  496.      } colorName2[1];                                     * Variable size  
  497. */
  498. struct CMTextDescriptionType {
  499.     OSType                             typeDescriptor;                /* 'desc' */
  500.     unsigned long                     reserved;                    /* fill with 0x00 */
  501.     unsigned long                     ASCIICount;                    /* the count of "bytes" */
  502.     unsigned char                     ASCIIName[2];                /* Variable size, to access fields after this one, have to count bytes */
  503.     unsigned long                     UniCodeCode;
  504.     unsigned long                     UniCodeCount;                /* the count of characters, each character has two bytes */
  505.     unsigned char                     UniCodeName[2];                /* Variable size */
  506.     short                             ScriptCodeCode;
  507.     unsigned char                     ScriptCodeCount;            /* the count of "bytes" */
  508.     unsigned char                     ScriptCodeName[2];            /* Variable size */
  509. };
  510. typedef struct CMTextDescriptionType CMTextDescriptionType;
  511.  
  512. struct CMTextType {
  513.     OSType                             typeDescriptor;                /* 'text' */
  514.     unsigned long                     reserved;                    /* fill with 0x00 */
  515.     unsigned char                     text[1];                    /* count of text is obtained from tag size element */
  516. };
  517. typedef struct CMTextType CMTextType;
  518.  
  519. struct CMScreeningType {
  520.     OSType                             typeDescriptor;                /* 'scrn' */
  521.     unsigned long                     reserved;                    /* fill with 0x00 */
  522.     unsigned long                     screeningFlag;                /* bit 0 : use printer default screens, bit 1 : inch/cm */
  523.     unsigned long                     channelCount;
  524.     char                             data[1];                    /* varaible size data as explained below */
  525. };
  526. typedef struct CMScreeningType CMScreeningType;
  527.  
  528. /*
  529.     A variable size array of structs appears as the last block of data
  530.     in the above struct, CMScreeningType.  The data structure
  531.     is as follows: (example in C)
  532.     
  533.     struct {
  534.         Fixed            frequency;
  535.         Fixed            angle;
  536.         unsigned long    sportFunction;
  537.      }    channelScreening[1];                             * Variable size 
  538. */
  539. struct CMSignatureType {
  540.     OSType                             typeDescriptor;                /* 'sig ' */
  541.     unsigned long                     reserved;                    /* fill with 0x00 */
  542.     OSType                             signature;
  543. };
  544. typedef struct CMSignatureType CMSignatureType;
  545.  
  546. struct CMS15Fixed16ArrayType {
  547.     OSType                             typeDescriptor;                /* 'sf32' */
  548.     unsigned long                     reserved;                    /* fill with 0x00 */
  549.     Fixed                             value[1];                    /* Variable size */
  550. };
  551. typedef struct CMS15Fixed16ArrayType CMS15Fixed16ArrayType;
  552.  
  553. struct CMU16Fixed16ArrayType {
  554.     OSType                             typeDescriptor;                /* 'uf32' */
  555.     unsigned long                     reserved;                    /* fill with 0x00 */
  556.     unsigned long                     value[1];                    /* Variable size */
  557. };
  558. typedef struct CMU16Fixed16ArrayType CMU16Fixed16ArrayType;
  559.  
  560. struct CMUInt16ArrayType {
  561.     OSType                             typeDescriptor;                /* 'ui16' */
  562.     unsigned long                     reserved;                    /* fill with 0x00 */
  563.     unsigned short                     value[1];                    /* Variable size */
  564. };
  565. typedef struct CMUInt16ArrayType CMUInt16ArrayType;
  566.  
  567. struct CMUInt32ArrayType {
  568.     OSType                             typeDescriptor;                /* 'ui32' */
  569.     unsigned long                     reserved;                    /* fill with 0x00 */
  570.     unsigned long                     value[1];                    /* Variable size */
  571. };
  572. typedef struct CMUInt32ArrayType CMUInt32ArrayType;
  573.  
  574. struct CMUInt64ArrayType {
  575.     OSType                             typeDescriptor;                /* 'ui64' */
  576.     unsigned long                     reserved;                    /* fill with 0x00 */
  577.     unsigned long                     value[1];                    /* Variable size (x2) */
  578. };
  579. typedef struct CMUInt64ArrayType CMUInt64ArrayType;
  580.  
  581. struct CMUInt8ArrayType {
  582.     OSType                             typeDescriptor;                /* 'ui08' */
  583.     unsigned long                     reserved;                    /* fill with 0x00 */
  584.     unsigned char                     value[1];                    /* Variable size */
  585. };
  586. typedef struct CMUInt8ArrayType CMUInt8ArrayType;
  587.  
  588. struct CMViewingConditionsType {
  589.     OSType                             typeDescriptor;                /* 'view' */
  590.     unsigned long                     reserved;                    /* fill with 0x00 */
  591.     CMFixedXYZColor                 illuminant;                    /* absolute XYZs of illuminant  in cd/m^2 */
  592.     CMFixedXYZColor                 surround;                    /* absolute XYZs of surround in cd/m^2 */
  593.     unsigned long                     stdIlluminant;                /* see definitions of std illuminants */
  594. };
  595. typedef struct CMViewingConditionsType CMViewingConditionsType;
  596.  
  597. struct CMXYZType {
  598.     OSType                             typeDescriptor;                /* 'XYZ ' */
  599.     unsigned long                     reserved;                    /* fill with 0x00 */
  600.     CMFixedXYZColor                 XYZ[1];                        /* variable size XYZ tristimulus values */
  601. };
  602. typedef struct CMXYZType CMXYZType;
  603.  
  604. /* Profile sequence description type */
  605. struct CMProfileSequenceDescType {
  606.     OSType                             typeDescriptor;                /* 'pseq ' */
  607.     unsigned long                     reserved;                    /* fill with 0x00 */
  608.     unsigned long                     count;                        /* Number of descriptions */
  609.     char                             data[1];                    /* varaible size data as explained below */
  610. };
  611. typedef struct CMProfileSequenceDescType CMProfileSequenceDescType;
  612.  
  613. /*
  614.     A variable size array of structs appears as the last block of data
  615.     in the above struct, CMProfileSequenceDescType.  The data structure
  616.     is as follows: (example in C)
  617.     
  618.      struct {                                             
  619.             OSType            deviceMfg;                     * Device Manufacturer 
  620.             OSType            deviceModel;                 * Decvice Model 
  621.             unsigned long    attributes[2];                 * Device attributes 
  622.             OSType            technology;                     * Technology signature 
  623.             unsigned long    mfgDescASCIICount;             * the count of "bytes" 
  624.             unsigned char    mfgDescASCIIName[2];         * Variable size 
  625.             unsigned long    mfgDescUniCodeCode;             
  626.             unsigned long    mfgDescUniCodeCount;         * the count of characters, each character has two bytes 
  627.             unsigned char    mfgDescUniCodeName[2];         * Variable size 
  628.             unsigned long    mfgDescScriptCodeCode;         
  629.             unsigned long    mfgDescScriptCodeCount;         * the count of "bytes" 
  630.             unsigned char    mfgDescScriptCodeName[2];     * Variable size 
  631.             unsigned long    modelDescASCIICount;         * the count of "bytes" 
  632.             unsigned char    modelDescASCIIName[2];         * Variable size 
  633.             unsigned long    modelDescUniCodeCode;         
  634.             unsigned long    modelDescUniCodeCount;         * the count of characters, each character has two bytes 
  635.             unsigned char    modelDescUniCodeName[2];     * Variable size 
  636.             short            modelDescScriptCodeCode;     
  637.             unsigned char    modelDescScriptCodeCount;     * the count of "bytes" 
  638.             SInt8            filler;                         * For proper alignment across languages 
  639.             unsigned char    modelDescScriptCodeName[2];     * Variable size 
  640.      }    profileDescription[1];                         
  641. */
  642. /* Under color removal, black generation type */
  643. struct CMUcrBgType {
  644.     OSType                             typeDescriptor;                /* 'bfd  ' */
  645.     unsigned long                     reserved;                    /* fill with 0x00 */
  646.     unsigned long                     ucrCount;                    /* Number of UCR entries */
  647.     unsigned short                     ucrValues[1];                /* variable size */
  648.     unsigned long                     bgCount;                    /* Number of BG entries */
  649.     unsigned short                     bgValues[1];                /* variable size */
  650.     unsigned char                     ucrbgASCII[1];                /* null terminated ASCII string */
  651. };
  652. typedef struct CMUcrBgType CMUcrBgType;
  653.  
  654. struct CMIntentCRDVMSize {
  655.     long                             renderingIntent;            /* rendering intent */
  656.     unsigned long                     VMSize;                        /* VM size taken up by the CRD */
  657. };
  658. typedef struct CMIntentCRDVMSize CMIntentCRDVMSize;
  659.  
  660. struct CMPS2CRDVMSizeType {
  661.     OSType                             typeDescriptor;                /* 'psvm' */
  662.     unsigned long                     reserved;                    /* fill with 0x00 */
  663.     unsigned long                     count;                        /* number of intent entries */
  664.     CMIntentCRDVMSize                 intentCRD[1];                /* variable size */
  665. };
  666. typedef struct CMPS2CRDVMSizeType CMPS2CRDVMSizeType;
  667.  
  668. /************************************************************************/
  669. /*************** ColorSync 1.0 profile specification ********************/
  670. /************************************************************************/
  671.  
  672. enum {
  673.     cmGrayResponse                = 0,
  674.     cmRedResponse                = 1,
  675.     cmGreenResponse                = 2,
  676.     cmBlueResponse                = 3,
  677.     cmCyanResponse                = 4,
  678.     cmMagentaResponse            = 5,
  679.     cmYellowResponse            = 6,
  680.     cmUcrResponse                = 7,
  681.     cmBgResponse                = 8,
  682.     cmOnePlusLastResponse        = 9
  683. };
  684.  
  685. /* Device types */
  686.  
  687. enum {
  688.     cmMonitorDevice                = 'mntr',
  689.     cmScannerDevice                = 'scnr',
  690.     cmPrinterDevice                = 'prtr'
  691. };
  692.  
  693. struct CMIString {
  694.     ScriptCode                         theScript;
  695.     Str63                             theString;
  696. };
  697. typedef struct CMIString CMIString;
  698.  
  699. /* Profile options */
  700.  
  701. enum {
  702.     cmPerceptualMatch            = 0x0000,                        /* Default. For photographic images */
  703.     cmColorimetricMatch            = 0x0001,                        /* Exact matching when possible */
  704.     cmSaturationMatch            = 0x0002                        /* For solid colors */
  705. };
  706.  
  707. /* Profile flags */
  708.  
  709. enum {
  710.     cmNativeMatchingPreferred    = 0x00000001,                    /* Default to native not preferred */
  711.     cmTurnOffCache                = 0x00000002                    /* Default to turn on CMM cache */
  712. };
  713.  
  714. typedef long CMMatchOption;
  715. typedef long CMMatchFlag;
  716. struct CMHeader {
  717.     unsigned long                     size;
  718.     OSType                             CMMType;
  719.     unsigned long                     applProfileVersion;
  720.     OSType                             dataType;
  721.     OSType                             deviceType;
  722.     OSType                             deviceManufacturer;
  723.     unsigned long                     deviceModel;
  724.     unsigned long                     deviceAttributes[2];
  725.     unsigned long                     profileNameOffset;
  726.     unsigned long                     customDataOffset;
  727.     CMMatchFlag                     flags;
  728.     CMMatchOption                     options;
  729.     CMXYZColor                         white;
  730.     CMXYZColor                         black;
  731. };
  732. typedef struct CMHeader CMHeader;
  733.  
  734. struct CMProfileChromaticities {
  735.     CMXYZColor                         red;
  736.     CMXYZColor                         green;
  737.     CMXYZColor                         blue;
  738.     CMXYZColor                         cyan;
  739.     CMXYZColor                         magenta;
  740.     CMXYZColor                         yellow;
  741. };
  742. typedef struct CMProfileChromaticities CMProfileChromaticities;
  743.  
  744. struct CMProfileResponse {
  745.     unsigned short                     counts[9];
  746.     unsigned short                     data[1];                    /* Variable size */
  747. };
  748. typedef struct CMProfileResponse CMProfileResponse;
  749.  
  750. struct CMProfile {
  751.     CMHeader                         header;
  752.     CMProfileChromaticities         profile;
  753.     CMProfileResponse                 response;
  754.     CMIString                         profileName;
  755.     char                             customData[1];                /* Variable size */
  756. };
  757. typedef struct CMProfile CMProfile;
  758.  
  759. typedef CMProfile *CMProfilePtr;
  760. typedef CMProfilePtr *CMProfileHandle;
  761. #if OLDROUTINENAMES
  762.  
  763. enum {
  764.     kCMApplProfileVersion        = cmCS1ProfileVersion
  765. };
  766.  
  767.  
  768. enum {
  769.     grayResponse                = cmGrayResponse,
  770.     redResponse                    = cmRedResponse,
  771.     greenResponse                = cmGreenResponse,
  772.     blueResponse                = cmBlueResponse,
  773.     cyanResponse                = cmCyanResponse,
  774.     magentaResponse                = cmMagentaResponse,
  775.     yellowResponse                = cmYellowResponse,
  776.     ucrResponse                    = cmUcrResponse,
  777.     bgResponse                    = cmBgResponse,
  778.     onePlusLastResponse            = cmOnePlusLastResponse
  779. };
  780.  
  781.  
  782. enum {
  783.     rgbData                        = cmRGBData,
  784.     cmykData                    = cmCMYKData,
  785.     grayData                    = cmGrayData,
  786.     xyzData                        = cmXYZData
  787. };
  788.  
  789.  
  790. enum {
  791.     XYZData                        = cmXYZData
  792. };
  793.  
  794.  
  795. enum {
  796.     monitorDevice                = cmMonitorDevice,
  797.     scannerDevice                = cmScannerDevice,
  798.     printerDevice                = cmPrinterDevice
  799. };
  800.  
  801.  
  802. enum {
  803.     CMNativeMatchingPreferred    = cmNativeMatchingPreferred,    /* Default to native not preferred */
  804.     CMTurnOffCache                = cmTurnOffCache                /* Default to turn on CMM cache */
  805. };
  806.  
  807.  
  808. enum {
  809.     CMPerceptualMatch            = cmPerceptualMatch,            /* Default. For photographic images */
  810.     CMColorimetricMatch            = cmColorimetricMatch,            /* Exact matching when possible */
  811.     CMSaturationMatch            = cmSaturationMatch                /* For solid colors */
  812. };
  813.  
  814. typedef unsigned short XYZComponent;
  815. typedef CMXYZColor XYZColor;
  816. typedef unsigned short CMResponseData;
  817. typedef CMIString IString;
  818. typedef long CMResponseColor;
  819. typedef CMResponseColor responseColor;
  820. #endif
  821.  
  822. #if PRAGMA_ALIGN_SUPPORTED
  823. #pragma options align=reset
  824. #endif
  825.  
  826. #if PRAGMA_IMPORT_SUPPORTED
  827. #pragma import off
  828. #endif
  829.  
  830. #ifdef __cplusplus
  831. }
  832. #endif
  833.  
  834. #endif /* __CMICCPROFILE__ */
  835.  
  836.